﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>
<%@ Import Namespace="System.Collections.Generic" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	测压仪观测（每月）
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div id="dolphincontainer">
	    <div id="dolphinnav">
	        <ul>
                <li><a href="/Record/StackWater/<%=ViewData["id"] %>?date=<%=(DateTime)ViewData["originalDate"] %>&factoryId=<%=ViewData["factoryId"] %>"><span>水位及水质</span></a></li>
                <li><a href="/Record/BackWater/<%=ViewData["id"] %>?date=<%=(DateTime)ViewData["originalDate"] %>&factoryId=<%=ViewData["factoryId"] %>"><span>进浆及回水</span></a></li>
                <li><a href="/Record/Settle/<%=ViewData["id"] %>?date=<%=(DateTime)ViewData["originalDate"] %>&factoryId=<%=ViewData["factoryId"] %>"><span>沉降及位移观测</span></a></li>
                <li><a href="/Record/Ardealite/<%=ViewData["id"] %>?date=<%=(DateTime)ViewData["originalDate"] %>&factoryId=<%=ViewData["factoryId"] %>"><span>磷石膏堆积坝</span></a></li>
                <li><a href="/Record/Ditch/<%=ViewData["id"] %>?date=<%=(DateTime)ViewData["originalDate"]%>&factoryId=<%=ViewData["factoryId"] %>"><span>截洪沟</span></a></li>
                <li><a href="/Record/PiezometerWell/<%=ViewData["id"] %>?date=<%=(DateTime)ViewData["originalDate"]%>&factoryId=<%=ViewData["factoryId"] %>"><span>测压井</span></a></li>
                <li><a href="javascript:return(false);" class="current"><span>测压仪</span></a></li>
                <li><a href="/Record/Drain/<%=ViewData["id"] %>?date=<%=(DateTime)ViewData["originalDate"]%>&factoryId=<%=ViewData["factoryId"] %>"><span>导渗系统</span></a></li>
	        </ul>
	    </div>
	</div>

    <%
           bool result = (bool)ViewData["success"];
           if(result){ 
        %>
           <div style="margin-top:20px;font-weight:bold;color:blue;text-align:center">测压仪数据更新成功</div>
        <%
        }
        %>

    <% using (Html.BeginForm())
    {
        List<Piezometer_base_info> topEquaps = (List<Piezometer_base_info>)ViewData["topEquaps"];
        List<Piezometer_base_info> bottomEquaps = (List<Piezometer_base_info>)ViewData["bottomEquaps"];
        List<Piezometer_monthly_info> topEquapsRecord = (List<Piezometer_monthly_info>)ViewData["topEquapsRecord"];
        List<Piezometer_monthly_info> bottomEquapsRecord = (List<Piezometer_monthly_info>)ViewData["bottomEquapsRecord"];
    %>

        <%= Html.ValidationSummary(true) %>
        <%= Html.Hidden("stack_id", ViewData["id"])%>
        <%= Html.Hidden("factoryId", ViewData["factoryId"]) %>
        <%= Html.Hidden("date", (DateTime)ViewData["date"])%>
            
    <table class="tableCss" cellspacing="0" cellpadding="0" align="center" border="0" style="margin-top:10px">
        <tr>
            <th colspan="2" class="heightrow" align="center" style="text-align:center">
                测压仪观测（每月）
            </th>
        </tr>
        <tr>
            <td class="row1" align="left" width="100px" style="padding-left:20px">查看测压仪位置：</td>
            <td class="row1" align="left">
                &nbsp;<%if (!string.IsNullOrEmpty((string)ViewData["piezometerEquapPic"])){ %><a href="<%=Url.Content((string)ViewData["piezometerEquapPic"]) %>" target="_blank">测压仪位置图</a><%} %>
            </td>
        </tr>
        <tr>
            <td class="row1" align="left" width="100px" style="padding-left:20px">测量人员：</td>
            <td class="row1" align="left">
                <%= Html.DropDownList("tester_id", ViewData["users"] as List<SelectListItem>, "请选择", new { style = "width:150px" })%>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <table width="100%" border="1px" style="background-color:White;border:1px solid gray;">
                    <tr height="25px">
                        <td>测压孔编号</td>
                        <td>测压仪编号</td>
                        <td>测量模数（digit)</td>
                        <td>测量温度  (℃)</td>
                        <td>意见</td>
                    </tr>
                    <%
                        if (topEquaps != null & topEquaps.Count > 0)
                        {
                            for (int i = 0; i < topEquaps.Count; i++)
                            {
                                bool hasTopRecord = topEquapsRecord != null && topEquapsRecord.Count > i;
                                bool hasBottomRecord = bottomEquapsRecord != null && bottomEquapsRecord.Count > i;
                    %>
                    <tr height="25px">
                        <td rowspan="2"><%=topEquaps[i].piezometer_hole_id%></td>
                        <td><%=topEquaps[i].piezometer_name%></td>
                        <td><input type="text" value="<%=hasTopRecord ? (topEquapsRecord[i].gauge_Modulus.HasValue ? topEquapsRecord[i].gauge_Modulus.Value.ToString() : "") : ""%>" name="gauge_Modulus_1_<%=i+1 %>" /></td>
                        <td><input type="text" value="<%=hasTopRecord ? (topEquapsRecord[i].gauge_temperature.HasValue ? topEquapsRecord[i].gauge_temperature.Value.ToString() : ""): ""%>" name="gauge_temperature_1_<%=i+1 %>" /></td>
                        <td><input type="text" value="<%=hasTopRecord ? topEquapsRecord[i].Remarks : ""%>" name="Remarks_1_<%=i+1 %>" /></td>
                    </tr>
                    <tr height="25px">
                        <td><%=bottomEquaps[i].piezometer_name%></td>
                        <td><input type="text" value="<%=hasBottomRecord ? (bottomEquapsRecord[i].gauge_Modulus.HasValue ? bottomEquapsRecord[i].gauge_Modulus.Value.ToString() : "") : ""%>" name="gauge_Modulus_2_<%=i+1 %>" /></td>
                        <td><input type="text" value="<%=hasBottomRecord ? (bottomEquapsRecord[i].gauge_temperature.HasValue ? bottomEquapsRecord[i].gauge_temperature.Value.ToString() : ""): ""%>" name="gauge_temperature_2_<%=i+1 %>" /></td>
                        <td><input type="text" value="<%=hasBottomRecord ? bottomEquapsRecord[i].Remarks : ""%>" name="Remarks_2_<%=i+1 %>" /></td>
                    </tr>
                    <%
                            }
                        }
                    %>

                </table>
            </td>
        </tr>

    </table>
    <div style="margin-top:25px;text-align:center">
        <input type="submit" value="提    交" style="font-size:16px;font-weight:bold" />
    </div>
    <% } %>
</asp:Content>
